import requests
import csv
from bs4 import BeautifulSoup
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
}
a = 1
for start_num in range(0,250,25):
    # print(start_num)

    http = f"https://movie.douban.com/top250?start={start_num}"
    response = requests.get(http,headers=headers)
    html = response.text
    # print(html)
    # print(response.status_code)

    soup = BeautifulSoup(html,"html.parser")
    all_title = soup.findAll("span" , attrs = {"class": "title"})
    # print(all_title)
    for title in all_title:
        title_string = title.string

        if "/" not in title_string:
            print(a , title_string)
            a = a + 1
